<?php
/**
 * @Author:      ZH
 * @DateTime:    2016-11-21 14:35:55
 * @Description: PMS 操作日志
 */
class PmsOpLog extends Eloquent
{
    protected $table = "pms_op_log";

    public static function write($model,$supplier_id,$type,$content,$old,$new,$by){
        $lo = new PmsOpLog();
        $lo->model = $model;
        $lo->supplier_id = $supplier_id;
        $lo->op_type = $type;
        $lo->op_content = $content;
        $lo->old_data = $old;
        $lo->new_data = $new;
        $lo->created_at = Common::currentTimeString();
        $lo->created_by = $by;
        $lo->created_type = 2;
        $lo->save();
    }
}